package org.jbit.news.listener;

import java.util.List;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;


import org.jbit.news.biz.impl.TopicBizImpl;
import org.jbit.news.entity.Topic;

public class GLobalResourceInitListenter implements ServletContextListener {
	
		

	public void contextDestroyed(ServletContextEvent sce) {
			
	}

	public void contextInitialized(ServletContextEvent sce) {
			ServletContext application =sce.getServletContext();
			List<Topic> topics =new TopicBizImpl().getAllTopics();
			
			application.setAttribute("ALL_NEWS_TOPICS", topics);
			
	}

}
